package spring.JUNIT.IOC;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class InjectionServiceImpl implements InjectionService {

	@Autowired
	private InjectionDao injectionDao;

	public InjectionServiceImpl(InjectionDao injectionDao) {
		this.injectionDao = injectionDao;
	}

	@Override
	public void save(String a) {
		// 模拟业务操作
		System.out.println("Service 接收:" + a);
		a = a + a.hashCode();
		injectionDao.save(a);
	}

	public void setInjectionDao(InjectionDao injectionDao) {
		this.injectionDao = injectionDao;

	}
}
